<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Mod_head extends CI_Controller {

    public $rear = '';

    function __construct() {
        parent::__construct();
        if($this->session->userdata('ngonngu') && $this->session->userdata('ngonngu')=='_en') {
            $this->rear = '_en';
            $this->lang->load('atta','english');
        }else{
            $this->lang->load('atta','vietnam');
        } 
    }

    public function index() {
        $setting = $this->common_model->getone('setting', array('id' => 1));
        $this->load->view('mod_head/views_head', array('setting' => $setting));
    }
    public function getMenuTop() {
        $setting = $this->common_model->getone('setting', array('id' => 1));
        $this->load->view('mod_head/viewsTopMenu.php',array('setting' => $setting));
    }
    public function bannerIndex() {
        $setting = $this->common_model->getone('setting', array('id' => 1));
        $this->load->view('mod_head/view_banner', array('setting' => $setting));
    }
    
    function lang_vi(){
        if($this->session->userdata('ngonngu')!=''){
            $this->session->unset_userdata('ngonngu');
        }
        redirect(base_url());
    }
     function lang_en(){
        if($this->session->userdata('ngonngu')=='') {
            $this->session->set_userdata('ngonngu','_en');
        }
        redirect(base_url());
    }

}
